home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nestle National Geograph… Channel Junior Explorers
/
Underwater Explo.iso
/
mac
/
content
/
screensaver.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2006-07-13
|
4KB
|
170 lines
getUrl("FSCommand:showmenu", "false");
getUrl("FSCommand:fullscreen", "true");
MovieClip.prototype.movescaleTo = function(endyVal, endxVal, scaleVal, deltaVal)
{
this.onEnterFrame = function()
{
diff = scaleVal - this._xscale;
this._xscale = this._yscale += diff / deltaVal;
if(Math.round(this._xscale) == scaleVal)
{
this._xscale = this._yscale = scaleVal;
scaleDone = true;
}
diff = endxVal - this._x;
diffy = endyVal - this._y;
this._x = this._x += diff / deltaVal;
this._y = this._y += diffy / deltaVal;
if(Math.round(this._x) == endxVal)
{
this._x = this._x = endxVal;
xDone = true;
}
if(Math.round(this._y) == endyVal)
{
this._y = this._y = endyVal;
yDone = true;
}
if(xDone && yDone && scaleDone)
{
xDone = false;
yDone = false;
scaleDone = false;
this._xscale = this._yscale = scaleVal;
this.onEnterFrame = null;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.moverTo = function(endyVal, endxVal, delta)
{
this.onEnterFrame = function()
{
diff = endxVal - this._x;
diffy = endyVal - this._y;
this._x = this._x += diff / delta;
this._y = this._y += diffy / delta;
if(Math.round(this._x) == endxVal)
{
this._x = this._x = endxVal;
xDone = true;
}
if(Math.round(this._y) == endyVal)
{
this._y = this._y = endyVal;
yDone = true;
}
if(xDone && yDone)
{
xDone = false;
yDone = false;
this.onEnterFrame = null;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.moveMeX = function(xPos, speed)
{
this.onEnterFrame = function()
{
this._xpos += (xPos - this._x) / speed;
if(Math.abs(xPos - this._x) < 0.5)
{
this._x = xPos;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.fade = function(step, endVal)
{
endVal = !endVal ? (step >= 0 ? 100 : 0) : endVal;
var dir = this._alpha <= endVal ? "up" : "down";
this.onEnterFrame = function()
{
this._alpha += step;
if(this._alpha <= endVal && dir == "down" || this._alpha >= endVal && dir == "up")
{
this._alpha = endVal;
this.onEnterFrame = null;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.fadeAndScale = function(step, alphaVal, scaleVal, deltaVal)
{
var dir = this._alpha <= alphaVal ? "up" : "down";
scaleDone = alphaDone = false;
this.onEnterFrame = function()
{
this._alpha += step;
diff = scaleVal - this._xscale;
this._xscale = this._yscale += diff / deltaVal;
if(this._alpha <= alphaVal && dir == "down" || this._alpha >= alphaVal && dir == "up")
{
this._alpha = alphaVal;
alphaDone = true;
}
if(Math.round(this._xscale) == scaleVal)
{
this._xscale = this._yscale = scaleVal;
scaleDone = true;
}
if(alphaDone && scaleDone)
{
this._alpha = alphaVal;
this._xscale = this._yscale = scaleVal;
this.onEnterFrame = null;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.rewindTo = function(targ, step)
{
this.onEnterFrame = function()
{
if(this._currentframe > targ)
{
i = 0;
while(i < step)
{
this.prevFrame();
i++;
}
}
else
{
this.gotoAndStop(targ);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.forwardTo = function(targ, step)
{
this.onEnterFrame = function()
{
if(this._currentframe < targ)
{
i = 0;
while(i < step)
{
this.nextFrame();
i++;
}
}
else
{
this.gotoAndStop(targ);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.umpleMa = function()
{
this.beginFill(16777200,0);
this.moveTo((- this._width) / 2,(- this._height) / 2);
this.lineTo(this._width / 2,(- this._height) / 2);
this.lineTo(this._width / 2,this._height / 2);
this.lineTo((- this._width) / 2,this._height / 2);
this.endFill();
};